<template>
  <div class="container">
    <!-- 头部区域 -->
    <HeadBar></HeadBar>
    <!-- 主内容区域 -->
    <Main></Main>
    <!-- 导航菜单栏 -->
    <Footer></Footer>


  </div>
</template>

<script>
  import HeadBar from "./HeadBar/HeadBar"
  import Main from "./Main/Main"
  import Footer from "./Footer/Footer"
  export default {
    components:{
      HeadBar,
      Main,
      Footer
    },
    mounted:function () {
      this.getUser()
    },
    methods: {
      getUser(){
        let u = JSON.parse(sessionStorage.getItem("user"));
        let i = sessionStorage.getItem("img");
        if(u){
          this.$store.state.isLogin = true;
          this.$store.state.name = u.name;
          this.$store.state.img = u.img;
          this.$store.state.createTime = u.createTime;
        }
        if(i){
          this.$store.state.img = i;
        }
      }
    }
  }

</script>

<style lang="scss">
.container{
  width: 1024px;
  margin:0 auto
}
</style>
